Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest: Skip non-directories when resolving workspace members #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarijnS95
Copy link
Member

Fixes #29

If globs provided in the members array resolve to files, even if none of its results are (symlinks to) directories or if the path is a relative path to a file without any globbing directives, cargo skips it without error. Cargo only errors out if the glob (or again relative path) didn't resolve to any files at all (which is what glob::glob() should also be doing for us).

It does however support symlinks, meaning we need to canonicalize every result to follow any symlinks before deducing if the entry is a directory that needs to be treated as a workspace member crate.

If globs provided in the `members` array resolve to files, even if
none of its results are (symlinks to) directories or if the path is a
relative path to a file without any globbing directives, `cargo` skips
it without error.  Cargo only errors out if the glob (or again relative
path) didn't resolve to any files at all (which is what `glob::glob()`
should also be doing for us).

It does however support symlinks, meaning we need to canonicalize
every result to follow any symlinks before deducing if the entry is a
directory that needs to be treated as a workspace member crate.
@MarijnS95 MarijnS95 force-pushed the workspace-members-skip-non-directories branch from be36a4d to c6d4721 Compare November 29, 2024 22:40
@@ -11,6 +11,6 @@ pub use args::Args;
pub use artifact::{Artifact, ArtifactType};
pub use config::{EnvError, EnvOption, LocalizedConfig};
pub use error::Error;
pub use manifest::CrateType;
pub use manifest::{CrateType, Manifest};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting complains that one field is not read inside Manifest -> Workspace. We don't expose any public API with Manifest yet but might as well export it.

Or should we mark it all pub(crate)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: src/examples/README.md/Cargo.toml: Not a directory
1 participant